package com.wangcang.widgetlibrary.list;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.wangcang.widgetlibrary.R;
import com.wangcang.widgetlibrary.activity.base.BaseActivity;
import com.wangcang.widgetlibrary.adapter.RadioListAdapter;
import com.wangcang.widgetlibrary.bean.SelectBean;

import java.util.ArrayList;
import java.util.List;

/**
 *  单选列表
 * Created by ShineF on 2017/7/12 0012.
 */

public class RadioListActivity extends BaseActivity {

    private ListView mLvRadio;
    private TextView mTvTitle;
    ImageView mBackBt;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_radio_list);
        init();
    }

    public void init(){
        mLvRadio = (ListView) findViewById(R.id.lv_radio_list);
        mTvTitle = (TextView) findViewById(R.id.title_text);
        mBackBt = (ImageView) findViewById(R.id.back_bt);
        mTvTitle.setText("单选列表");
        List<SelectBean> dataList = new ArrayList<>();
        for(int i = 0 ; i < 100 ; i++){
            dataList.add(new SelectBean("入库点数", false));
        }
        RadioListAdapter adapter = new RadioListAdapter(this, dataList);
        mLvRadio.setAdapter(adapter);

        mBackBt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finishActivity();
            }
        });
    }
}
